import java.io.*;

public class CommentsDestroyer {
    private enum CommentsDestroyerState {
        NONE,
        SINGLE_LINE,
        MULTILINE
    }

    private String input;
    private int index = 0;

    public CommentsDestroyer(String input) {
        this.input = input;
    }

    public String run() {
        StringBuilder sb = new StringBuilder();
        CommentsDestroyerState state = CommentsDestroyerState.NONE;
        while (index < input.length()) {
            char ch = input.charAt(index);
            switch (state) {
                case MULTILINE:
                    if (ch == '*' && lookahead('/')) {
                        state = CommentsDestroyerState.NONE;
                        index++;
                    }
                    break;
                case SINGLE_LINE:
                    if (ch == '\n') {
                        state = CommentsDestroyerState.NONE;
                    }
                    break;
                default:
                    if (ch == '/' && lookahead('/')) {
                        state = CommentsDestroyerState.SINGLE_LINE;
                        index++;
                    } else if (ch == '/' && lookahead('*')) {
                        state = CommentsDestroyerState.MULTILINE;
                        index++;
                    } else {
                        sb.append(ch);
                    }
                    break;
            }
            index++;
        }
        return sb.toString();
    }

    private boolean lookahead(char ch) {
        return index + 1 < input.length() && input.charAt(index + 1) == ch;
    }

    public static void main(String[] args) throws Exception {
        // Change input.txt file to test CommentsDestroyer
        // [XXX] I do not know how to pass \n char with args array
        // For simplicity just read all file contents to local variable instead of stream-like reading
        String input = readFile("input.txt");
        System.out.println(new CommentsDestroyer(input).run());

    }

    private static String readFile(String fileName) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader(fileName));
        StringBuilder sb = new StringBuilder();
        int charCode;
        while ((charCode = br.read()) != -1) {
            sb.append((char)charCode);
        }
        return sb.toString();
    }
}